package lihua.robot.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lihua.robot.mapper.XsmzlTableMapper;
import lihua.robot.pojo.XsmzlTable;
import lihua.robot.service.XsmzlTableService;
import org.springframework.stereotype.Service;

/**
* @author huanghan
* @description 针对表【xsmzl_table】的数据库操作Service实现
* @createDate 2024-02-21 15:26:16
*/
@Service
public class XsmzlTableServiceImpl extends ServiceImpl<XsmzlTableMapper, XsmzlTable>
    implements XsmzlTableService {

    @Override
    @DS("slave_1")
    public String selectDqcd3(Integer devsn) {
        LambdaQueryWrapper<XsmzlTable> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(XsmzlTable::getCj,"三纺")
                .eq(XsmzlTable::getDevsn,devsn)
                .orderByDesc(XsmzlTable::getId)
                .last("LIMIT 1");
        XsmzlTable xsmzlTable = this.baseMapper.selectOne(wrapper);
        return xsmzlTable.getDqcd();
    }


}




